<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><spring:message code="project_title" /></title>
<link rel="stylesheet" type="text/css" href="/pimtool/css/pimstyle.css" />

</head>

<body>
<div id="logo"><img id="logo_elca"
	src="/pimtool/images/logo_elca.gif" /></div>

<div id="header"><spring:message code="project_title" /></div>
<div id="main_menu">
<div class="menu_division">Search</div>
<ul class="menu_item">
	<li><a href="#">Project</a></li>
	<li><a href="#">Affair</a></li>
	<li><a href="#">Customer</a></li>
	<li><a href="#">Account</a></li>
	<li><a href="#">Supplier</a></li>
</ul>
<div class="menu_division">New</div>
<ul class="menu_item">
	<li><a href="#">Project</a></li>
	<li><a href="#">Customer</a></li>
	<li><a href="#">Supplier</a></li>
</ul>
</div>
<div id="main_content">
<div id="title"><spring:message code="project_search_title" /></div>
<div id="error">
<spring:hasBindErrors name="query">
    <ul>
        <c:forEach items="${errors.allErrors}" var="error">
            <li><span class="error"><spring:message message="${error}" /></span></li>
        </c:forEach>
    </ul>
</spring:hasBindErrors></div>
<div id="search_projects"><form:form method="POST"
	action="searchProjects" commandName="query">
	<table>
		<tr>
			<td class="column"><spring:message code="project_number" /></td>
			<td class="column"><form:input path="searchNumber" /></td>
			<td class="column"><spring:message code="project_customer" /></td>
			<td class="column"><form:input path="searchCustomer" /></td>
		</tr>
		<tr>
			<td><spring:message code="project_name" /></td>
			<td><form:input path="searchName" /></td>
			<td><spring:message code="project_status" /></td>
			<td><form:input path="searchStatus" /></td>
		</tr>
		<tr>
			<td colspan="4">&nbsp;</td>
		</tr>
		<tr>
			<td align="center" colspan="4"><input type="submit"
				value="<spring:message code="search"/>" /> <input type="reset"
				value="<spring:message code="reset"/>" /></td>
		</tr>
	</table>
</form:form></div>
<c:if test="${not empty projects}">
<div id="result_table"><form:form method="POST"
	action="deleteProjects" commandName="list">
	<input type="submit" value="delete"/>
	<table border="1">
		<tr class="table_header">
			<th></th>
			<th class="th_number"><spring:message code="project_number" /></th>
			<th class="th_name"><spring:message code="project_name" /></th>
			<th class="th_status"><spring:message code="project_status" /></th>
			<th class="th_customer"><spring:message code="project_customer" /></th>
			<th class="th_startDay"><spring:message code="project_startDay" /></th>
		</tr>
		<c:forEach items="${projects}" var="project">
			<tr>
				<td></td>
				<td><a href="editProject?pid=${project.id}"><c:out
					value="${project.number}" /></a></td>
				<td><c:out value="${project.name}" /></td>
				<td><c:out value="${project.status}" /></td>
				<td><c:out value="${project.customer}" /></td>
				<td><c:out value="${project.startDate}" /></td>
			</tr>
		</c:forEach>
	</table>
</form:form></div></c:if>
</div>
</body>
</html>